import Mockjs from 'mockjs';
 // var Mockjs = require('mockjs')
 const { Random }= Mockjs;
 const phonePrefix = ['132', '135', '189']
 const index = Math.floor(Math.random() * phonePrefix.length)
 var phone = phonePrefix[index] + Mockjs.mock(/\d{8}/)

import Mock from 'mockjs'
Mock.mock('/api/user/getSex', 'post', {
  code: 200,
  message: 'success',
  data: {
    'token': '@guid',
    'name': '@cname',
    'age|20-60': 1,
    'avatar': "@image('100x100', '#4A7BF7', 'Avatar')"
  }
})

Mock.mock('/api/user/info', 'get', {
  code: 200,
  message: 'success',
  data: {
    'id': '@id',
    'name': '@cname',
    'email': '@email',
    'phone': /^1[385][1-9]\d{8}/,
    'address': '@county(true)',
    'createTime': '@datetime'
  }
})


